package br.ucb.bsiLab2.view;

import java.awt.Component;

import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.table.TableCellRenderer;

public class ButtonRender extends JButton implements TableCellRenderer{

	private static final long serialVersionUID = 1L;

	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		
		this.setText("BTN TESTE");
		
		if (hasFocus)  
        {  
            this.setForeground(table.getForeground());  
            this.setBackground(UIManager.getColor("Button.background"));  
        }  
        else if (isSelected)  
        {  
            this.setForeground(table.getSelectionForeground());  
             this.setBackground(table.getSelectionBackground());  
        }  
        else  
        {  
            this.setForeground(table.getForeground());  
            this.setBackground(UIManager.getColor("Button.background"));  
        }
		
		return this;
	}

}
